﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Text;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

namespace RCMS.Web.WebControls
{
    [DefaultProperty("Text")]
    [ToolboxData("<{0}:LabelRemarks runat=server></{0}:LabelRemarks>")]
    public class LabelRemarks : Label
    {
        protected override void RenderContents(HtmlTextWriter writer)
        {
            if (DesignMode)
            {
                base.RenderContents(writer);
            }
            else
            {
                var s = this.Page.Server.HtmlEncode(this.Text ?? "");
                s = s.Replace("\r\n", "<br />");
                writer.Write(s);
            }
        }
    }
}
